

/*---------------------------------------------------------
   Name: gamemode:PlayerSpawnObject( ply )
   Desc: Called to ask whether player is allowed to spawn any objects
---------------------------------------------------------*/
function GM:PlayerSpawnObject( ply )
	return true
end


/*---------------------------------------------------------
   Name: LimitReachedProcess
---------------------------------------------------------*/
local function LimitReachedProcess( ply, str )

	// Always allow in single player
	if (SinglePlayer()) then return true end

	local c = server_settings.Int( "sbox_max"..str, 0 )
	
	if ( ply:GetCount( str ) < c || c < 0 ) then return true end 
	
	ply:LimitHit( str ) 
	return false

end



/*---------------------------------------------------------
   Name: gamemode:PlayerSpawnProp( ply, model )
   Desc: Return true if it's allowed 
---------------------------------------------------------*/
function GM:PlayerSpawnProp( ply, model )

	return LimitReachedProcess( ply, "props" )

end

/*---------------------------------------------------------
   Name: gamemode:PlayerSpawnedProp( ply, model, ent )
   Desc: Called after the player spawned a prop
---------------------------------------------------------*/
function GM:PlayerSpawnedProp( ply, model, ent )

	ply:AddCount( "props", ent )
	
end


/*---------------------------------------------------------
   Name: gamemode:PlayerSpawnSWEP( ply, wname, wtable )
   Desc: Return true if it's allowed 
---------------------------------------------------------*/
function GM:PlayerSpawnSWEP( ply, wname, wtable )

	return true
	
end


/*---------------------------------------------------------
   Name: gamemode:PlayerGiveSWEP( ply, wname, wtable )
   Desc: Return true if it's allowed 
---------------------------------------------------------*/
function GM:PlayerGiveSWEP( ply, wname, wtable )

	return true
	
end


/*---------------------------------------------------------
   Name: gamemode:PlayerSpawnSENT( ply, name )
   Desc: Return true if player is allowed to spawn the SENT
---------------------------------------------------------*/
function GM:PlayerSpawnSENT( ply, name )
		
	return true
	
end
